package com.situ.study.day9.cal;

//对修改封闭，对扩展开放
public abstract class Cal {
    protected int num1;
    protected int num2;

    public Cal() {
    }

    public Cal(int num1, int num2) {
        this.num1 = num1;
        this.num2 = num2;
    }

    /*public int getResult() {
        System.out.println("Cal.getResult");
        //父类并不知道具体实现哪个操作，return 0;是为了不报错
        return 0;
    }*/

    //Missing method body, or declare abstract
    //Abstract method in non-abstract class
    public abstract int getResult();

    public int getNum1() {
        return num1;
    }

    public void setNum1(int num1) {
        this.num1 = num1;
    }

    public int getNum2() {
        return num2;
    }

    public void setNum2(int num2) {
        this.num2 = num2;
    }
}
